using System;
using System.Collections.Generic;
using System.Text;
namespace Utils
{
    public class Encryption
    {
        public static string ToByte64String(string text)
        {
            string ret = string.Empty;

            try
            {
                ret = Convert.ToBase64String(Encoding.UTF8.GetBytes(text));
            }
            catch
            {

            }

            return ret;
        }

        public static string FromByte64String(string text)
        {
            string ret = string.Empty;

            try
            {
                ret = Encoding.UTF8.GetString(Convert.FromBase64String(text));
            }
            catch
            {

            }

            return ret;
        }
    }
}
